# base image
FROM centos:7
# author info
MAINTAINER cqbvc<cloud computing>
# build command
RUN yum install -y wget proc-devel net-tools gcc zlib zlib-devel make openssl-devel
RUN wget http://nginx.org/download/nginx-1.9.7.tar.gz
RUN tar zxf nginx-1.9.7.tar.gz
# compile and install
WORKDIR nginx-1.9.7
RUN ./configure --prefix=/usr/local/nginx && make && make install
# expose the ports
EXPOSE 80
EXPOSE 443
# modify the config file of nginx
RUN echo "daemon off;" >> /usr/local/nginx/conf/nginx.conf
# set the authority
WORKDIR /root/nginx
ADD run.sh /run.sh
RUN chmod 775 /run.sh
# start container command
CMD ["/run.sh"]
